{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 精准度-召回率曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "digits = datasets.load_digits()\n",
    "X = digits.data\n",
    "y = digits.target.copy()\n",
    "\n",
    "y[digits.target==9] = 1\n",
    "y[digits.target!=9] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "log_reg = LogisticRegression()\n",
    "log_reg.fit(X_train, y_train)\n",
    "decision_scores = log_reg.decision_function(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.metrics import precision_score\n",
    "from sklearn.metrics import recall_score\n",
    "\n",
    "precisions = []\n",
    "recalls = []\n",
    "thresholds = np.arange(np.min(decision_scores), np.max(decision_scores), 0.1)\n",
    "for threshold in thresholds:\n",
    "    y_predict = np.array(decision_scores >= threshold, dtype='int')\n",
    "    precisions.append(precision_score(y_test, y_predict))\n",
    "    recalls.append(recall_score(y_test, y_predict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQ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aqdBOg8nXNvO+dqnHPTnXPT8X6NP945\nt40AnaeZnYt3TeGTzrn2HpsCc45pmTw3IieZ1/r4CbDKOfcvPTYtAS5Pv74ceCSbxw1cy70fVwO3\nm1kE6ASuAXDe/PQPAO/i/ep7nXMu6V+ZQ3YPcI+ZvQN0AZenW3xBO88+Bezn+UO8ETFPpH9Deck5\nd23AzhF3kOdG+FxWtnwEuBR428zeSK/7W+AWvC7TL+GN9vpMNg+qO1RFRAIo37plRETygsJdRCSA\nFO4iIgGkcBcRCSCFu4hIACncRUQCSOEuIhJACncRkQD6/+BwknC87QilAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10dda2b38>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(thresholds, precisions)\n",
    "plt.plot(thresholds, recalls)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Precision-Recall 曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE9tJREFUeJzt3X+MXeV95/H31zO2sY3BP/llezIumFJXwQEmJAtsliRK\ni8m2blZJC6kShaa12IbsaldaBaWrVqtUaqpspG5aEtdCNGq7ClUSkjjFhERKCmmIW8wGMA4/OnEA\n2wP4N7bHYw8z890/5hLGg8f3zsyde+88835JI80555lzvjwaPn7muec8JzITSVJZZjW7AElS/Rnu\nklQgw12SCmS4S1KBDHdJKpDhLkkFMtwlqUCGuyQVyHCXpAK1N+vCy5Yty87OzmZdXpKmpccee+xA\nZi6v1q5p4d7Z2cn27dubdXlJmpYi4oVa2jktI0kFMtwlqUCGuyQVyHCXpAIZ7pJUoKrhHhH3RMS+\niHhqjOMREV+IiO6IeDIirq5/mZK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PqEqSQVyWkaSCmS4S1KBDHdJ\nKpDhLkkFMtwlqUCGuyQVyHCXpAIZ7pJUoP8PNxiQ4BASF/gAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10dde0cf8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(precisions, recalls)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### scikit-learn中的Precision-Recall曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.metrics import precision_recall_curve\n",
    "\n",
    "precisions, recalls, thresholds = precision_recall_curve(y_test, decision_scores)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145,)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "precisions.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145,)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recalls.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(144,)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "thresholds.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VNXBx/HvyU5WIAQChBD2VUSJbCqCqCCtIq6odcEF\nUbHa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wFLAcuCrWM3vt+AWwE1gMXuv16\n1sv1ArAKWOl9w7Z3O1O9bOOAb7yv2y/cztNAvq7A197LmlDKCLyCs1ujxvuevBlIxzmyYwPwIdA6\nBDOG1PsROAtnl8tKb8d85X1fBvS11BmqIiIRSLtlREQikMpdRCQCqdxFRCKQyl1EJAKp3EVEIpDK\nXUQkAqncRUQikMpdRCQC/T/h2z9YI1kP+wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x111763ba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(thresholds, precisions[:-1])\n",
    "plt.plot(thresholds, recalls[:-1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFcNJREFUeJzt3X+Q1fV97/Hnm4UV+aXILqAgAgYkaGOrq+Zap0lsEn9k\nrE2TSTWd2pqk1Dsxt9PepObemTTNtX+Yye1MbxIjZRxjk94Jd9rYBBOi7a1N7NRrFVMRUHFWEFl+\nyK4QfiMs+75/7NEcN8B+D5yz5+yX52OGmT3f7+ec78uvy4vv+Xy/53wjM5EklcuYZgeQJNWf5S5J\nJWS5S1IJWe6SVEKWuySVkOUuSSVkuUtSCVnuklRClrskldDYZm24o6Mj586d26zNS9Ko9Mwzz/Rl\nZudw45pW7nPnzmXVqlXN2rwkjUoRsanIOKdlJKmELHdJKiHLXZJKyHKXpBKy3CWphIYt94h4ICJ2\nRMTa46yPiPhqRHRHxHMRcVn9Y0qSalHkyP1B4PoTrL8BWFD5swS479RjSZJOxbDlnpmPAztPMORm\n4Fs56Eng7Ig4t14Bj+fg4aP8+Yp1bN55oNGbkqRRpx5z7rOAzVWPeyrLfkFELImIVRGxqre395Q2\nuvzpV3n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d8n8AR5sbqXkK3YlpBBW60fabMvPxiJgfER2Z2YzvlSiS\ntwtYPvjOlg7gxojoz8xmlOaweTNzT9XPKyPiGy2+f3uA1zNzP7A/Ih4HLgVeGpmIb1PL7+8tNG9K\nBoplvR24pzIN2h0RGxmcy35qZCK+TdHf3dth8GQlsBHYMFIBT0JNfVezZp5wOMYJhrEM/s+Yx89P\nmlw8ZMw7+PkJ1csqOyNaNe+Q8Q/S3BOqRfbvzKr9eyXwaivvXwanDf65MnYCsBa4pFXzVsadxeBc\n7MQW/124D/jzys8zKn/XOlo479lUTvgCf8DgfHZT9m9Vprkc/4Tqh3j7CdWn6rntljpyz2I34/4I\ncFtEHAEOAr+dlT3VonlbRsG8HwX+c0T0M7h/b2nl/ZuZL0TEI8BzwABwf2Ye89KzVshbGfph4B9z\n8N1GUxTMejfwYESsYbCA7srmvIMrmvedwN9ERALrgE82I+ubIuI7DF591hERPcAXgXHwVt6VDF4x\n0w0coPKuo27bb9LfW0lSA43KE6qSpBOz3CWphCx3SSohy12SSshyl6QSstwlqYQsd0kqIctdkkro\n/wM5zZOR9hkNfQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x111763e10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(precisions, recalls)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
